<div class="container-fluid">

<div class="panel">
  <div class="panel-body">
	<input type="text" class="form-control" id="username" placeholder="用户账号"><br>
  (密码留空为默认值：123456)
	<input type="text" class="form-control" id="password" placeholder="用户密码"><br>
  (金币留空为默认值：0)
	<input type="text" class="form-control" id="money" placeholder="用户金币"><br>
  (默认为非会员)
    <div class="radio-primary"><input type="radio" name="vip" value="1"><label for="primaryradio1">会员</label></div>
<div class="radio-primary"><input type="radio" name="vip" value="0"><label for="primaryradio2">非会员</label></div>
	<center><button class="btn btn-info" id="btn">添加</button></center>
  </div>
</div>
<script>
$('.btn').on('click', function() {
    $.post("../api.php",
    {
        index:'adduser',
        username: $("#username").val(),
        password: $("#password").val(),
        money: $("#money").val(),
        vip: $('input:radio:checked').val()
    },
    function(data,status){
        var json = JSON.parse(data);
        if (json['code'] == 0) {
          new $.zui.Messager(json['msg'], {
            icon: 'bell' // 定义消息图标
        }).show();
        }else{
          new $.zui.Messager(json['msg'], {
            icon: 'bell' // 定义消息图标
        }).show();
        }
    });
});
</script>
</div>
</body>
</html>